﻿@model Wicresoft.UnifyShow2.Portal.ViewModels.PagedDeviceModel
@{
    var grid = new WebGrid(null, rowsPerPage: Model.PageSize,
         ajaxUpdateContainerId: "gridDeviceTable", canPage: true, canSort: true, ajaxUpdateCallback: "initTheDeviceAcitons");
    grid.Bind(Model.Devices, new[] { "Identify", "Type", "Object", "SubObject", "CreateTime" }, autoSortAndPage: false, rowCount: int.Parse(Model.TotalRows + ""));
}
<div id="gridDeviceTable">
    @grid.GetHtml(tableStyle: "ContactTB talbe_gray", headerStyle: "ContactTH", htmlAttributes: new { width = "100%", border = 0, cellpadding = 0, cellspacing = 0 },
                    columns: grid.Columns(grid.Column("Identify", "设备的特性值"),
            grid.Column("Type", "分类"),
            grid.Column("Object", "项目"),
            grid.Column("SubObject", "子项目"),
            grid.Column("CreateTime", "创建时间"),
            grid.Column("CreateTime", "操作", format: @<text> <a href="#@item.ID" data-id="@item.ID" class="editDevice" >
                编辑</a> | <a href="#@item.ID" data-id="@item.ID" class="deleteDevice">删除</a></text>)))
</div>
<p>
    <input type="button" class="Button1 ui-icons" id="createDevice" value="添加设备" />
</p>
